package top.kwanghuee.shop.product.service.impl;

import com.alibaba.fastjson.JSON;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.Service;
import top.kwanghuee.domain.Product;
import top.kwanghuee.shop.product.mapper.ProductMapper;
import top.kwanghuee.shop.service.ProductService;

import javax.annotation.Resource;

/**
 * @author: kwanghuee
 * @date: 2020/9/11 13:35
 */
@Service
@Slf4j
public class ProductServiceImpl implements ProductService {
    
    @Resource
    private ProductMapper productMapper;
    
    public Product findByPid(Integer pid) {
        Product product = productMapper.findByPid(pid);
        log.info("查询到{}号商品的信息--->{}",pid, JSON.toJSONString(product));
        return product;
    }
}
